package org.example.zhuangtaiji.action;

import org.example.zhuangtaiji.data.Order;
import org.example.zhuangtaiji.enums.OrderStatusChangeEventEnum;
import org.example.zhuangtaiji.enums.OrderStatusEnum;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;
import org.springframework.stereotype.Service;

/**
 * @author czj
 * @date 2024/12/7
 * @description
 */
@Service
public class OrderCreateAction implements Action<OrderStatusEnum, OrderStatusChangeEventEnum> {
    @Override
    public void execute(StateContext<OrderStatusEnum, OrderStatusChangeEventEnum> stateContext) {
        Order order = (Order) stateContext.getMessageHeaders().get("order");
        System.out.println("创建订单持久化");
    }
}
